home *** CD-ROM | disk | FTP | other *** search
- Path: su3.in.net!news
- From: poundss@in.net (Sam Pounds)
- Newsgroups: comp.lang.c
- Subject: Re: Pointer Conversion
- Date: Sun, 21 Jan 1996 02:17:01 GMT
- Organization: INTERNET Indiana
- Message-ID: <4ds6s3$ft6@su3.in.net>
- References: <4ds4jq$fo4@su3.in.net>
- NNTP-Posting-Host: pm2-17.in.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- poundss@in.net (Sam Pounds) wrote:
-
-
- >char *my_strcat(const char *a, const char *b)
- >{
- > char done[1024];
- > char *p = done;
-
- > while (*a)
- > *p++ = *a++;
- > while (*b)
- > *p++ = *b++;
- > *p = '\0';
- > return done; /* this is the suspicious pointer conversion error */
- >}
-
- Sorry, it just dawned on me.
- char *done = (char *)malloc(1024);
-
- But if anyone could tell me how I could just alloc the
- necessary memory for the two pointers I would appreciate it.
- Sorry again.
-
-
-
-